package com.wcity.manage.common.config;

import com.wcity.manage.common.context.SpringContext;

import java.util.List;

/**
 * 系统配置
 *
 * @author dy
 *
 */
public class AppConfig {

    private List<String> skipUrl;
    private boolean debug;
    private String localUrl;
    private String dwzAssetsUrl;

    private String accessKeySecret;
    private String accessKeyId;
    private String bucketName;
    private String endpoint;
    private String urlPrefix;
    private String appImgsObject;

    private static AppConfig app;
    private static final Object lock = new Object();

    public static AppConfig getInstace() {

        if ( app != null  ) return app;

        synchronized ( lock ) {

            if ( SpringContext.getApplicationContext() != null ) {
                app = (AppConfig) SpringContext.getApplicationContext().getBean( "appConfig" );
                return app;
            }
            return null;
        }
    }

    public List<String> getSkipUrl() {
        return skipUrl;
    }
    public void setSkipUrl(List<String> skipUrl) {
        this.skipUrl = skipUrl;
    }
    public String getLocalUrl() {
        return localUrl;
    }
    public void setLocalUrl(String localUrl) {
        this.localUrl = localUrl;
    }
    public boolean isDebug() {
        return debug;
    }
    public void setDebug(boolean debug) {
        this.debug = debug;
    }
    public String getDwzAssetsUrl() {
        return dwzAssetsUrl;
    }
    public void setDwzAssetsUrl(String dwzAssetsUrl) {
        this.dwzAssetsUrl = dwzAssetsUrl;
    }

    public String getAccessKeySecret() {
        return accessKeySecret;
    }
    public void setAccessKeySecret(String accessKeySecret) {
        this.accessKeySecret = accessKeySecret;
    }
    public String getAccessKeyId() {
        return accessKeyId;
    }
    public void setAccessKeyId(String accessKeyId) {
        this.accessKeyId = accessKeyId;
    }
    public String getBucketName() {
        return bucketName;
    }
    public void setBucketName(String bucketName) {
        this.bucketName = bucketName;
    }
    public String getEndpoint() {
        return endpoint;
    }
    public void setEndpoint(String endpoint) {
        this.endpoint = endpoint;
    }
    public String getUrlPrefix() {
        return urlPrefix;
    }
    public void setUrlPrefix(String urlPrefix) {
        this.urlPrefix = urlPrefix;
    }
    public String getAppImgsObject() {
        return appImgsObject;
    }
    public void setAppImgsObject(String appImgsObject) {
        this.appImgsObject = appImgsObject;
    }
}
